<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <title>学生登陆界面</title>
    <link href="${pageContext.request.contextPath}/bootstrap/css/bootstrap.css" rel="stylesheet"/>
    <link href="${pageContext.request.contextPath}/bootstrap/css/bootstrap-responsive.css" rel="stylesheet"/>
    <script src="${pageContext.request.contextPath}/bootstrap/js/jQuery.js" type="text/javascript"></script>
    <script src="${pageContext.request.contextPath}/bootstrap/js/bootstrap.js" type="text/javascript"></script>
    <script type="text/javascript">
        function checkForm() {
            var cardNo =  $("#cardNo").val();
            var password =  $("#password").val();
            if (cardNo == null || cardNo == "") {
                alert("准考证号不能为空！");
                return false;
            }
            if (password == null || password == "") {
                alert("登录密码不能为空！");
                return false;
            }
            return true;
        }

        function resetValue() {
            $("#id").val("");
            $("#password").val("");
        }

        if ('${error}' != '') {
            alert('${error}');
        }
    </script>
</head>
<body>
<div align="center" style="padding-top: 20px;">
    <form action="userAction!login" method="post" onsubmit="return checkForm()">
        <table width="1004" height="584" background="image/login.jpg" <%--border="1px solid red"--%>>
            <tr height="200">
                <td colspan="4"></td>
            </tr>
            <tr height="10">
                <td width="68%"></td>
                <td width="10%"><label>准考证号：</label></td>
                <td><input type="text" id="cardNo" name="student.cardNo" value="${currentUser.cardNo }"/></td>
                <td width="30%"></td>
            </tr>
            <tr height="10">
                <td width="68%"></td>
                <td width="10%"><label>密码：</label></td>
                <td><input type="password" id="password" name="student.password" value="${currentUser.password }"/></td>
                <td width="30%"></td>
            </tr>
            <tr height="10">
                <td width="68%"></td>
                <td width="10%">
                    <button class="btn btn-primary" type="submit">登录</button>
                </td>
                <td>
                    <button class="btn btn-primary" type="button" onclick="resetValue()">重置</button>
                </td>
                <td width="30%"></td>
            </tr>
            <tr>
                <td colspan="4"></td>
            </tr>
        </table>
    </form>
</div>
</body>
</html>